package org.anderground.editor.gui.menubar;

import java.awt.KeyEventDispatcher;
import java.awt.event.KeyEvent;

import javax.swing.JMenuBar;

import org.anderground.editor.gui.MainWindow;

/**
 * 
 * @author Ilya Shurigyn
 * 
 */
public class EditorMenuBar extends JMenuBar {
	public EditorMenuBar(MainWindow parent) {
		add(new FileMenu(parent));
		add(new EditMenu(parent));

		javax.swing.FocusManager.getCurrentKeyboardFocusManager()
				.addKeyEventDispatcher(new KeyEventDispatcher() {

					@Override
					public boolean dispatchKeyEvent(KeyEvent arg0) {
						// TODO
						/*
						 * if(arg0.getID()==arg0.KEY_RELEASED) {
						 * if(arg0.isControlDown() &&
						 * arg0.getKeyCode()==arg0.VK_Z) {
						 * EditorModel.getInstance().undo(); return true; }
						 * 
						 * if(arg0.isControlDown() &&
						 * arg0.getKeyCode()==arg0.VK_Y) {
						 * EditorModel.getInstance().redo(); return true; } }
						 */
						return false;
					}

				});
	}

}
